package com.xiaojian.pick.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@Data
public class Seek {

    private Integer id;     // 主键
    private String title;   // 求购标题
    private String remark;  // 备注
    private Integer state;  // 求购信息状态（0，已删除；1，存在中）
    private Double minPrice;    // 最低价格
    private Double maxPrice;    // 最高价格
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date publishDate;   // 发布时间

    private User user;     // 求购发布者

    public Seek(Integer id, String title, String remark, Integer state, Double minPrice, Double maxPrice, Date publishDate, User user) {
        this.id = id;
        this.title = title;
        this.remark = remark;
        this.state = state;
        this.minPrice = minPrice;
        this.maxPrice = maxPrice;
        this.publishDate = publishDate;
        this.user = user;
    }

    public Seek() {
    }

    @Override
    public String toString() {
        return "Seek{" +
                "id=" + id +
                ", title='" + title + '\'' +
                ", remark='" + remark + '\'' +
                ", state=" + state +
                ", minPrice=" + minPrice +
                ", maxPrice=" + maxPrice +
                ", publishDate=" + publishDate +
                ", user=" + user +
                '}';
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    public Double getMinPrice() {
        return minPrice;
    }

    public void setMinPrice(Double minPrice) {
        this.minPrice = minPrice;
    }

    public Double getMaxPrice() {
        return maxPrice;
    }

    public void setMaxPrice(Double maxPrice) {
        this.maxPrice = maxPrice;
    }

    public Date getPublishDate() {
        return publishDate;
    }

    public void setPublishDate(Date publishDate) {
        this.publishDate = publishDate;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }
}